home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Util / Ah-Az / AppleShare Kill Folder / Kill AppleShare Logins.a < prev    next >
Encoding:
Text File  |  1988-06-22  |  2.5 KB  |  129 lines  |  [TEXT/MPS ]

  1.     Title    'Kill off stupid assholes who have AppleShare Volumes log in.'
  2.  
  3. ;_____________________________________________________________________________________
  4. ;
  5. ;    Unit    Kill AppleShare Logins.a
  6. ;
  7. ;    Use    Kills off the AppleShare volumes specified to automatically log in
  8. ;        when the machine is restarted. Make the first INIT in the system folder.
  9. ;
  10. ;        This INIT works by opening the file 'AppleShare Prep' in the system folder,
  11. ;        and deleting the BMLS resource in the file. This resource is the
  12. ;        means AppleShare uses to store the information about the devices
  13. ;        and usernames to log in at system startup.
  14. ;
  15. ;        To assemble and link:
  16. ;
  17. ;    asm "{Target}"
  18. ;    link 'HDisk:Kill AppleShare Logins.a.o' -o 'HDisk: AppleShare Kill' -t INIT -rt INIT ∂
  19. ;    -ra Main=$54
  20. ;    ResEdit
  21. ;
  22. ;    Created    21 June 1988
  23. ;    Author    Bob Hablutzel
  24. ;        John Norstad
  25. ;
  26. ;    Contact    Bob Hablutzel
  27. ;        Northwestern University ACNS Development
  28. ;        2129 Sheridan Road #130
  29. ;        Evanston, IL  60208
  30. ;        (312) 491-4059
  31. ;
  32. ;        AppleLink:    A0173
  33. ;        BitNet:        BOB@NUACC    (Prefered)
  34. ;        InterNet:    Bob@NUACC.ACNS.NWU.EDU    (Just as good)
  35. ;        CompuServe:    76474,154
  36. ;
  37. ;    Mods    None, so far
  38. ;
  39. ;_____________________________________________________________________________________
  40.  
  41.     Include    'Traps.a'            ; Include trap definitions
  42.     Include    'ToolEqu.a'            ; Include Toolbox definitions
  43.  
  44.     PROC
  45.     
  46. ; Open the resource file.
  47.  
  48.     subq.l    #2,sp
  49.     lea    theFileName,A0
  50.     move.l    A0,D0
  51.     _StripAddress
  52.     move.l    D0,-(sp)
  53.     _OpenResFile
  54.     move.w    (sp)+,D7
  55.     bmi    SysBeep
  56.  
  57. ; Get the resource of type 'BMLS'
  58.  
  59.     subq.l    #4,sp
  60.     move.l    #'BMLS',-(sp)
  61.     move.w    #2447,-(sp)
  62.     _GetResource
  63.     move.l    (sp)+,D5
  64.     beq    NewResource
  65.  
  66. ; If the resource could not be gotten, do not kill it, but rather create it (id = 2447)
  67. ; so that things will work well in the future.
  68.  
  69.     tst.w    ResErr
  70.     bne    SysBeep
  71.  
  72. ; Set the handle size to 2, and clear out the data
  73.  
  74. UpdateD6:
  75.     move.l    D5,A0
  76.     move.l    (A0),D0
  77.     beq    SysBeep
  78.     _StripAddress
  79.     move.l    D0,A0
  80.     clr.w    (A0)
  81.     move.l    D5,A0
  82.     move.l    #2,D0
  83.     _SetHandleSize
  84.     bmi    SysBeep
  85.  
  86. ; Mark the resource as changed
  87.  
  88.     move.l    D5,-(sp)
  89.     _ChangedResource
  90.  
  91. ; Update the resource file
  92.  
  93.     move.w    D7,-(sp)
  94.     _UpdateResFile
  95.  
  96. ; Close the resource file
  97.  
  98.     move.w    D7,-(sp)
  99.     _CloseResFIle
  100.  
  101. ; That's it. Exit
  102.  
  103. Exit:    rts
  104.  
  105. ; Add a new version of the resource to the resource file
  106.  
  107. NewResource:
  108.     move.l    #2,D0
  109.     _NewHandle    ,Clear
  110.     bmi    SysBeep
  111.     pea    (A0)
  112.     move.l    #'BMLS',-(sp)
  113.     move.w    #2447,-(sp)
  114.     clr.l    -(sp)
  115.     _AddResource
  116.     bra    Exit    
  117.  
  118. ; The file did not exist - SysBeep
  119.  
  120. SysBeep:
  121.     move.w    #1,-(sp)
  122.     _SysBeep
  123.     bra    Exit
  124.  
  125. theFileName    dc.b    'AppleShare Prep'
  126.  
  127.     Endp
  128.     End
  129.